using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AdvancedApi.Models;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace AdvancedApi
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder1(args).Build().Run();
        }


        public static IHostBuilder CreateHostBuilder1(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureAppConfiguration(configurationBuilder =>
        {
            configurationBuilder.AddRedisConfiguration(new Models.RedisConfigurationOptions()
            {
                AutoReload = true,
                ConnectionString = "192.168.10.34:6379,password=123456",
                HashCacheKey = "aspnet:config",
                HashCacheChannel = "aspnet:config:change"
            });
        })
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.UseStartup<Startup>();
        });

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
    }
}
